<template>
	<view class="container">
		<!--左侧栏-->
		<view class="category">
			<view :class="item.page == indexs ? 'active':''" v-for="(item,index) in list" :key="index" @click="btnList(index)">{{item.name}}</view>
		</view>
		<!--右侧栏-->
		<view class="category_right">
			<view class="list">
				<dl>
					<dt>
						<image src="../../static/images/2.png"></image>
					</dt>
					<dd>
						<h2>海尔（Haier）1.5匹变频壁挂式卧室空调挂机 先行者 自清洁 PMV一键舒适 静音 KFR-35GW/05EDS83A</h2>
						<span>199.00</span>
					</dd>
				</dl>
			</view>
			<!-- <view class="nodata_text">该分类暂无数据</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[
					{
						name:'张三',
						page: 0
					},{
						name:'李四',
						page: 1
					},{
						name:'王五',
						page: 2
					},{
						name:'李六',
						page: 3
					}
				],
				indexs: 0
			}
		},
		methods: {
			btnList(val){
				this.indexs = val
			}
		},
		mounted() {}
	}
</script>

<style lang="scss">
	page {
		background: #fff;
	}

	.container {
		position: relative;
		height: 100vh;
		&:after {
			content: '';
			position: absolute;
			width: 100%;
			height: 1rpx;
			bottom: 0;
			border-bottom: 1rpx solid #f1f1f1;
		}
	}

	.category {
		width: 180rpx;
		background: #f6f6f6;
		view {
			line-height: 92rpx;
			text-align: center;
			&.active {
				background: #fff;
			}
			font-size: 28rpx;
		}
		height: 100vh;
	}

	.category_right {
		width: 570rpx;
		position: absolute;
		height: 100%;
		overflow-x: auto;
		top: 0;
		right: 0;
		dl {
			display: flex;
			padding: 28rpx 0 0 28rpx;
			&:last-child {
				padding: 28rpx 0 28rpx 28rpx;
				dd {
					border: none;
				}
			}
			image {
				width: 152rpx;
				height: 152rpx;
			}
			h2 {
				height: 80rpx;
				font-size: 28rpx;
				margin: 7rpx 0;
				overflow: hidden;
				display: -webkit-box;
				text-overflow: ellipsis;
				-webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
			}
			dd {
				color: #666;
				border-bottom: 1rpx solid #d8d8d8;
				padding-right: 48rpx;
				span {
					color: #ff5200;
					font-size: 32rpx;
					&:before {
						content: '￥';
						font-size: 20rpx;
					}
				}
				margin-left: 20rpx;
			}
		}
	}
</style>
